<template>
	<view>
		<button @click="goRsd()">refresh</button>
		<view v-for="index in count">
			<view style="height: 100rpx;background-color: antiquewhite;margin: 5rpx;">
				test{{index}}
				</view>
		</view>
		<view style="height: 100rpx;text-align: center;color: #aaa;">over</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				count:30
			}
		},
		onPullDownRefresh() {
			console.log("onPullDownRefresh start refreshing");
			//net request
			setTimeout(()=>{
				console.log("onPullDownRefresh finish");
				uni.stopPullDownRefresh()
			},2000)
		},
		onReachBottom() {
			//data rerefresh
			console.log("onReachBottom");
			if(this.count<200)
			this.count = this.count +30;
		},
		methods: {
			goRsd(){
				uni.startPullDownRefresh({
					success() {
						console.log("start refreshing success");
					},fail() {
						console.log("start refreshing fail");
					},complete() {
						console.log("start refreshing complete");
					}
				})
			}
		}
	}
</script>

<style>
button{
	margin: 20rpx;
}
</style>
